<!DOCTYPE html>
<html>
<head>
<title>订单管理</title>
#include("../include/common.html")
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>订单管理</h5>
            </div>
            <form id="listForm" action="list" method="get">
            	<input type="hidden" name="status" id="status" value="#(status)">
                <div class="ibox-content">
                    <!-- 搜索 start -->
                    <div class="form-horizontal clear">
                        <div class="form-group">
                            <label class="col-sm-1 control-label">编号：</label>
                            <div class="col-sm-2"><input class="form-control" type="text" name="sn" value="#(sn)"></div>
                        </div>
						<div class="form-group">
							<label class="col-sm-1 control-label">收货人：</label>
							<div class="col-sm-2"><input class="form-control" type="text" name="consignee" value="#(consignee)" placeholder="收货人姓名/手机号码"></div>
						</div>
                        <div class="text-center">
                            <input type="submit" class="btn btn-primary btn-w-m" value="查 询">
                            <input type="reset" class="btn btn-primary btn-w-m" value="重 置">
                        </div>
                    </div>
                    <!-- 搜索 end -->
                    <!-- 列表 start -->
                    <div class="form-horizontal clear">
                        <div class="form-group">
                            <div class="col-sm-8">
                                <a href="javascript:;" class="btn btn-primary" id="refreshButton"><i class="fa fa-refresh"></i> 刷新</a>
                            	<a href="export" class="btn btn-primary"><i class="fa fa-down"></i> 导出excel</a>
                            </div>
                        </div>
                        <div class="tabs-container">
		                   <ul class="nav nav-tabs">
		                        <li #if(status=="PENDING_SHIPMENT")class="active"#end><a data-toggle="tab" href="javascript:void(0)" onclick="statusSearch('PENDING_SHIPMENT')">待出库</a></li>
		                        <li #if(status=="PENDING_PAYMENT")class="active"#end><a data-toggle="tab" href="javascript:void(0)" onclick="statusSearch('PENDING_PAYMENT')">待付款</a></li>
		                        <li #if(status=="SHIPPED")class="active"#end><a data-toggle="tab" href="javascript:void(0)" onclick="statusSearch('SHIPPED')">已出库</a></li>
		                        <li #if(status=="COMPLETED")class="active"#end><a data-toggle="tab" href="javascript:void(0)" onclick="statusSearch('COMPLETED')">已签收</a></li>
		                        <li #if(status=="CANCELED")class="active"#end><a data-toggle="tab" href="javascript:void(0)" onclick="statusSearch('CANCELED')">已取消</a></li>
		                        <li #if(status=="CLOSED")class="active"#end><a data-toggle="tab" href="javascript:void(0)" onclick="statusSearch('CLOSED')">已关闭</a></li>
		                        <li #if(status??) #else class="active"#end><a data-toggle="tab" href="javascript:void(0)" onclick="statusSearch('')">全部订单</a></li>
		                    </ul>
		                    <div class="tab-content">
		                        <div class="tab-pane active">
		                            <div class="panel-body form-horizontal">
				                        <div class="table-responsive">
				                            <table class="table table-bordered" id="listTable">
				                                <thead>
				                                    <tr>
				                                        <th>ID</th>
				                                        <th>编号</th>
				                                        <th>金额</th>
				                                        <th>会员</th>
				                                        <th>收货人</th>
				                                        <th>支付方式</th>
				                                        <th>配送方式</th>
				                                        <th>状态</th>
				                                        <th>附言</th>
				                                        <th>创建日期</th>
				                                        <th>操作</th>
				                                    </tr>
				                                </thead>
				                                <tbody>
				                                    #for(order : page.list)
				                                    <tr>
				                                        <td>#(order.id)</td>
				                                        <td>#(order.sn)</td>
				                                        <td>#(order.amount)</td>
				                                        <td>
				                                        	ID:#(order.member.id)<br>
				                                        	昵称:#(order.member.nickname??"")<br>
				                                        	手机号码:#(order.member.mobile??"")<br>
				                                        </td>
				                                        <td>
				                                        	收货人:#(order.consignee)<br>
				                                        	手机号码:#(order.phone)<br>
				                                        	地址:#(order.province);#(order.city);#(order.district);#(order.address)<br>
				                                       	</td>
				                                        <td>#if(order.paymentMethod??) #(order.paymentMethodName) #else - #end</td>
				                                        <td>#(order.shippingMethod)</td>
				                                        <td>
				                                            #(order.statusName)
				                                        </td>
				                                        <td>#(order.memo)</td>
				                                        <td>#date(order.createDate,"yyyy-MM-dd")</td>
				                                        <td>
				                                            <a href="view?id=#(order.id)">[查看]</a>
				                                        </td>
				                                    </tr>
				                                    #end
				                                </tbody>
				                            </table>
                       					</div>
                   					</div>
               					</div>
           					</div>
       					</div>
                        <div class="text-center">
                            #pagination(pageNumber = page.pageNumber,totalPages = page.totalPage,pattern = "")
                                #include("../include/pagination.html")
                            #end
                        </div>
                    </div>
                    <!-- 列表 end -->
                </div>
            </form>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
function statusSearch(status){
	$("#status").val(status);
	$("#listForm").submit();
}
</script>